﻿/*
 * Copyright (c) 2015-2016 Constantijn Evenhuis (blueprints@const.nl)
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
using System;
using System.Diagnostics;

namespace Blueprints.IO
{
    /// <summary>
    /// A start node.
    /// </summary>
    [DebuggerDisplay("{Name}")]
    public sealed partial class StartNode : INode
    {
        /// <summary>
        /// Creates a new start node.
        /// </summary>
        /// <param name="name">The name of the node.</param>
        /// <param name="type">The type of node, or null to assume the type expected for this node.</param>
        /// <param name="id">The id of the node, of null if the node has no id.</param>
        /// <param name="link">The uri to which this node links, or null if the node does not link to another node.</param>
        public StartNode(string name, string type, string id, string link)
        {
            Name = name;
            Type = type;
            Id = id;
            Link = link;
        }

        /// <summary>
        /// Gets the name of the node.
        /// </summary>
        public string Name
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets the type of node, or null to assume the type expected for this node
        /// </summary>
        public string Type
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets the id of the node, of null if the node has no id.
        /// </summary>
        public string Id
        {
            get;
            internal set; // internal set, because Id can be set during serialization
        }

        /// <summary>
        /// Gets the uri to which this node links, or null if the node does not link to another node.
        /// </summary>
        public string Link
        {
            get;
            private set;
        }

        NodeType INode.NodeType
        {
            get { return NodeType.StartNode; }
        }

        string INode.Content
        {
            get { return null; }
        }
    }
}